import 'package:bilibili/navigator/hi_navigator.dart';
import 'package:bilibili/provider/theme_provider.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class HiTheme extends StatefulWidget {
  const HiTheme({super.key});

  @override
  State<StatefulWidget> createState() {
    return _HiThemeState();
  }
}

class _HiThemeState extends State<HiTheme> {
  @override
  Widget build(BuildContext context) {

    return InkWell(
      onTap: () {
        HiNavigator.getInstance().onJumpTo(RouteStatus.theme);
      },
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          const Text(
            "夜间模式",
            style: TextStyle(fontWeight: FontWeight.bold),
          ),
          const Padding(padding: EdgeInsets.only(left: 15)),
          Icon(context.watch<ThemeProvider>().isDark() ? Icons.nightlight_round : Icons.light_mode_rounded)
        ],
      ),
    );
  }
}
